<%--
  Created by IntelliJ IDEA.
  User: LT
  Date: 2018-11-09
  Time: 8:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="../bootstrap/css/bootstrap.css"/>
    <link rel="stylesheet" href="../validate/css/bootstrapValidator.css"/>
    <script type="text/javascript" src="../jquery-3.2.1.min.js"></script>
    <script type="text/javascript" src="../bootstrap/js/bootstrap.js"></script>
    <script type="text/javascript" src="../validate/js/bootstrapValidator.js"></script>

    <script>
        $(function () {
            $('#defaultForm').bootstrapValidator({
                message: '所输入的内容不合法',
                feedbackIcons: {
                    valid: 'glyphicon glyphicon-ok',
                    invalid: 'glyphicon glyphicon-remove',
                    validating: 'glyphicon glyphicon-refresh'
                },
                fields: {
                    username: {
                        message: '用户名不合法',
                        validators: {
                            notEmpty: {
                                message: '用户名不能为空！'
                            },
                            stringLength: {
                                min: 6,
                                max: 30,
                                message: '用户名必须在6-30个字符之间'
                            },
                            regexp: {
                                regexp: /^[a-zA-Z0-9_\.]+$/,
                                message: '字母大小写或者数字开头！'
                            }
                        }
                    },
                    email: {
                        validators: {
                            notEmpty: {
                                message: '电子邮件不能为空'
                            },
                            emailAddress: {
                                message: '邮件不合法'
                            }
                        }
                    }

                }
            });
        }) ;
    </script>



</head>
<body>

<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">用户登录</h3>
    </div>
    <div class="panel-body">
        <form action="" id="defaultForm">
            <div class="row">
                <div class="form-group">
                    <div class="col-sm-2"><label for="username" class="pull-right">用户名:</label></div>
                    <div class="col-sm-10">
                        <div>
                            <input type="text" class="form-control" name="username">
                        </div>
                    </div>
                </div>
            </div>
            <br/>
            <div class="row">
                <div class="form-group">
                    <div class="col-sm-2"><label for="email" class="pull-right">电子邮件:</label></div>
                    <div class="col-sm-10">
                        <div>
                            <input type="text" class="form-control" name="email">
                        </div>
                    </div>
                </div>
            </div>
            <br/>
            <button  class="btn btn-info col-sm-offset-2">提交</button>
        </form>

    </div>
</div>


</body>
</html>
